<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>物品删除系统</title>
  <meta name="keywords" content="">
  <meta name="description" content="">
  <link href="css/bootstrap.min.css-v=3.3.5.css" rel="stylesheet">
  <link href="css/font-awesome.min.css-v=4.4.0.css" rel="stylesheet">
  <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
  <link href="css/animate.min.css" rel="stylesheet">
  <link href="css/style.min.css-v=4.0.0.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
  <style>
    #zhuti1 {
      height: 100%;
    }

    #zhuti::before {
      background: url('img/lg.jpg') no-repeat fixed center;
      background-size: 300px;
      content: "";
      opacity: 0.2;
      /*透明度设置*/
      width: 80%;
      height: 80%;
      position: absolute;
    }
  </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins" id="zhuti1">

        <div class="ibox-title">
          <h3 style="font-weight: 600;margin-top: 0;">物品删除</h3>
        </div>

        <div class="ibox-content">
          <form method="post" id="bigform3" autocomplete="off" class="form-horizontal">

            <!--            &lt;!&ndash;                      第一行&ndash;&gt;-->
            <!--            <div class="form-group">-->
            <!--              <label class="col-sm-2 control-label">归还人</label>-->
            <!--              <div class="col-sm-3">-->
            <!--                <input type="text" name="returner" required placeholder="请输入归还人"-->
            <!--                       class="form-control size">-->
            <!--              </div>-->
            <!--              <label class="col-sm-2 control-label">联系方式</label>-->
            <!--              <div class="col-sm-4">-->
            <!--                <input type="text" name="returner_phone" required placeholder="请输入归还人的联系方式"-->
            <!--                       class="form-control size">-->
            <!--              </div>-->
            <!--            </div>-->



            <!--                      第一行-->
<!--            <div class="form-group">-->
<!--              <label class="col-sm-2 control-label">物品总数</label>-->
<!--              <div class="col-sm-3">-->
<!--                <input type="text" name="returner" required placeholder="请输入物品总数"-->
<!--                       class="form-control size">-->
<!--              </div>-->
<!--              <label class="col-sm-2 control-label">库存数</label>-->
<!--              <div class="col-sm-4">-->
<!--                <input type="text" name="returner_phone" required placeholder="请输入库存数"-->
<!--                       class="form-control size">-->
<!--              </div>-->
<!--            </div>-->




            <!--                        第二行-->
            <div class="form-group">
              <label class="col-sm-2 control-label">删除详情</label>
              <div class="col-sm-3" style="width: 75%">
                <input style="width: 100%" type="text" name="delete1" required placeholder="请输入删除物品的编号"
                       class="form-control size">
              </div>
              <!--              <label class="col-sm-2 control-label">值班人员</label>-->
              <!--              <div class="col-sm-4">-->
              <!--                <input type="text" name="zhibanren" required placeholder="请输入值班人员"-->
              <!--                       class="form-control size">-->
              <!--              </div>-->
            </div>




            <!--                        第三行-->
            <!--            <div class="form-group">-->
            <!--              <label class="col-sm-2 control-label">物品编号</label>-->
            <!--              <div class="col-sm-3">-->
            <!--                <input type="text" name="sign3" required placeholder="请输入归还物品的所有编号"-->
            <!--                       class="form-control size">-->
            <!--              </div>-->
            <!--              <label class="col-sm-2 control-label">归还物品是否有损坏</label>-->
            <!--              <input name="shi" type="button" style="margin-right: 1%;margin-left: 18px;" id="shi"-->
            <!--                     class="btn btn-primary" value="是">-->
            <!--              <input class="btn btn-white" id="fou" type="button" value="否">-->

            <!--            </div>-->




            <!--                        弹出的损坏情况-->
            <!--            <div class="form-group" style="display:none" zone="100" id="sunhuai">-->
            <!--              <label class="col-sm-2 control-label">损坏情况</label>-->
            <!--              <div class="col-sm-3">-->
            <!--                <input type="text" name="after_damage_details" required placeholder="请输入损坏情况"-->
            <!--                       class="form-control size">-->
            <!--              </div>-->
            <!--            </div>-->




            <!--                        第五行-->
            <div class="form-group">
              <div class="form-group">
                <div class="col-sm-3 col-sm-offset-4">

                  <input name="tijiao" type="button" style="margin-right: 20%;" id="tijiao"
                         class="btn btn-primary" value="删除">

                  <input class="btn btn-white" id="reset" type="reset" value="重新填写">
                </div>
              </div>
            </div>



          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js-v=2.1.4"></script>
<script src="layui/layer/layer.js" type="text/javascript" charset="utf-8"></script>

<script src="js/bootstrap.min.js-v=3.3.5"></script>
<script src="js/content.min.js-v=1.0.0"></script>
<script src="js/plugins/iCheck/icheck.min.js"></script>


<script>

  $(document).ready(function () {
    let id = 0;
    let state = "";

    <!--	获取url后边的参数-->
    function GetRequest() {
      const url = location.search; //获取url中"?"符后的字串
      let theRequest = new Object();
      if (url.indexOf("?") != -1)//判断不等于空
      {
        let str = url.substr(1);//抽取字符
        let strs = str.split("&");//抽取从&开始的
        for (let i = 0; i < strs.length; i++) {
          theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
      }
      return theRequest;
    }

    // // 判断是否
    // $("#shi").on("click", function () {
    //   //得到input标签对象
    //   document.getElementById('sunhuai').style.display = 'block';
    //
    // })
    // // 判断是否
    // $("#fou").on("click", function () {
    //   //得到input标签对象
    //   document.getElementById('sunhuai').style.display = 'none';
    //
    // })


    //提交
    let x = GetRequest();
    // console.log(x);
    let idd = x.id;
    $("#tijiao").on("click", function () {
      var delete1 = $("input[name='delete1']").val();
      // var returner = $("input[name='returner']").val();
      // var returner_phone = $("input[name='returner_phone']").val();
      // var returner_card = $("input[name='returner_card']").val();
      // var zhibanren = $("input[name='zhibanren']").val();
      // var sign3 = $("input[name='sign3']").val();
      // var after_damage_details = $("input[name='after_damage_details']").val();
      // var is_damage;
      // if(after_damage_details=="")
      //   is_damage="否";
      // else
      //   is_damage="是";

      name1 = name;
      // console.log(parseInt(name1))
      //传值

      $.ajax({
        type: "POST",
        url: "/updateBySigns",
        data: {
          "id": idd,
          "signs": delete1,
          // "returner_phone": returner_phone,
          // "returner_card": returner_card,
          // "zhibanren": zhibanren,
          // "sign": sign3,
          // "after_damage_details": after_damage_details,
          // "is_damage": is_damage,


        },
        success: function (msg) {
          if (msg == 1) {
            layer.alert("删除成功");
            //提交成功后清空
            $("input[name='delete1']").val("");
            window.setInterval(function () {
              top.location.href = "/index";
            }, 1500);
          } else {
            layer.alert("删除失败");
          }

        },
        error: function (nn) {
          layer.alert("删除失败");
          // console.log(nn);
        },
      });
      return false;
    });
    return false;
  });

</script>
</body>

</html>
